{{#tree-list}}
    {{#tree-list-item hasChildren=true as |options|}}
        {{#if (eq options.section "item")}}
            {{#list-item-text class="title project-listing"}}
                Project
                {{#animation-container
                    hide=isPublished
                    class="inline project-changes"
                    setHeight=false
                }}
                    {{#link-to 'projects'}}Show all projects{{/link-to}}
                {{/animation-container}}
                {{#animation-container hide=notPublished id="project-changes-info" class="inline project-changes" setHeight=false}}
                    Not published
                    {{#help-icon tooltipClasses="tooltip-wide"}}
                        Not published
                        <p>
                            This project has changes that have not yet been published.
                        </p>
                        <p>
                            When you make changes in Portia a private workspace is created for your
                            user, separate from the rest of the project. Other users cannot see
                            these changes until they are published, and you cannot see changes that
                            were published by other users after you started making changes.
                        </p>
                        <p>
                            To run a spider or make your changes visible to other users you must
                            first publish ({{icon-button icon='publish'}}) the changes.
                        </p>
                        <p>
                            To clean your private workspace, and get back to the most recently
                            published version of your project, you can discard your changes
                            ({{icon-button icon='rollback'}}).
                        </p>
                    {{/help-icon}}
                {{/animation-container}}
            {{/list-item-text}}
        {{else if (eq options.section "subtrees")}}
            {{#tree-list-item}}
                {{#link-to 'projects.project' project}}
                    {{indentation-spacer}}
                    {{list-item-icon icon='project'}}
                    {{#list-item-text}}
                        {{project.name}}
                    {{/list-item-text}}
                {{/link-to}}

                {{#list-item-icon-menu
                  onClick=(action 'clickProjectOptions')
                  icon='vertical-ellipsis' as |options|
                }}
                    {{#if (and versionControlled hasChanges)}}
                        <li><a {{action (chain-actions (action 'publish')
                                         options.closeMenu)}}>
                            {{list-item-icon
                              class="icon"
                              icon="publish"}}Publish project
                        </a></li>
                        <li><a {{action (chain-actions (action 'discard')
                                         options.closeMenu)}}>
                            {{list-item-icon
                              class="icon"
                              icon="rollback"}}Discard changes
                        </a></li>
                    {{else if deployable}}
                        <li><a {{action (chain-actions (action 'deploy')
                                         options.closeMenu)}}>
                            {{list-item-icon
                              class="icon"
                              icon="publish"}}Deploy project
                        </a></li>
                    {{/if}}
                    <li> <a href={{downloadUrl}} target='_blank'>
                        {{list-item-icon class="icon" icon="download"}}Download as Portia
                    </a> </li>
                    <li><a href={{downloadCodeUrl}} target='_blank'>
                        {{list-item-icon class="icon" icon="code"}}Download as Scrapy
                    </a> </li>
                {{/list-item-icon-menu}}
                <div class={{if isPulsing 'droplet'}}></div>

            {{/tree-list-item}}
        {{/if}}
    {{/tree-list-item}}
{{/tree-list}}
